#ifndef CSE220_project3_Scanner_h
#define CSE220_project3_Scanner_h

#include <fstream>
#include <time.h>
#include "common.h"
#include "Print.h"
using namespace std;

class Print;
class Tokenizer;

class Scanner
{
public:
    Scanner(const string &);
    void ScanFile(Tokenizer &);
    char FetchCharacter();
    void BackUpCharacter();
    ~Scanner();
    
private:
    Print *printer;
    FILE *sourceFile;
    string sourceLine;
    char sourceChars[MAX_SOURCE_LINE_LENGTH];
    CharCode charTable[256];
    int pageNumber;
    int lineNumber;
    string fileName;
    int sourceLineIndex;
    
    bool FetchSourceLine();
    void SkipComment();
    void PrintLine();
    void PrintToken(Tokenizer &);
    void PrintPageHeader();

};

#endif
